package com.cola.demo;

import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

/**
 * @Grup:com.cola.demo
 * @Auther:cola
 * @Data:2021/4/20-2021-04-23:46
 * @version:1.0
 */
@Component
//@Scope("prototype")
//@Scope(scopeName = "prototype")
@Scope(ConfigurableBeanFactory.SCOPE_SINGLETON)
@Lazy
public class Notepad2 {
    public Notepad2() {
        super();
        System.out.println("Notepad2的构造函数......"+this.toString());
    }
    @PostConstruct
    public void init(){
        System.out.println("Notepad2的初始化方法");
    }
    @PreDestroy
    public void destroy(){
        System.out.println("Notepad2的销毁方法");
    }

}
